package com.xx.news.activity;

import android.content.Intent;
import android.os.Bundle;

import androidx.databinding.library.baseAdapters.BR;

import com.bumptech.glide.Glide;
import com.xx.news.R;
import com.xx.news.base.BaseActivity;
import com.xx.news.databinding.ActivityQicheInfoBinding;
import com.xx.news.databinding.ActivityToutiaoInfoBinding;
import com.xx.news.entity.Qiche;
import com.xx.news.entity.Toutiao;
import com.xx.news.viewmodel.QicheInfoViewModel;
import com.xx.news.viewmodel.ToutiaoInfoViewModel;

public class QicheInfoActivity extends BaseActivity<ActivityQicheInfoBinding, QicheInfoViewModel> {

    @Override
    public void initData() {
        super.initData();
        Intent intent = getIntent();
        Qiche.ListBean item = (Qiche.ListBean) intent.getSerializableExtra("bean");
        viewModel.item.set(item);

        Glide.with(this)
                .asBitmap()
                .load(item.getImgsrc().replace(",", ":"))
                .into(binding.image);
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_qiche_info;
    }
}
